<?php echo form_tag_for($contactForm,$contactForm->getUrl(),array('id'=>'formContact',)); ?>
<div class="infobox1" style="height:200px;">
  <?php echo $contactForm->renderGlobalErrors()?>
  <?php include_partial('contact_fields',array('contactForm'=>$contactForm))?>
</div>
<div class="form_buttons"> 
  <input type="submit" value="Save" id="buttonSaveContact"/>
    <?php if(! $contactForm->isNew()):?>
      | <input type="button" value="Delete" id="buttonDeleteContact"/>
      <?php if($contactForm->getObject()->getStatus()=='ACTIVE'):?>
        | <input type="button" value="Deactivate" id="buttonStatusContact"/>
      <?php else:?>
        | <input type="button" value="Activate" id="buttonStatusContact"/>
      <?php endif;?>
    <?php endif;?>
    | <input type="button" value="Reset" id="buttonResetContact"/>
</div>
</form>

<script language="javascript">
  $(document).ready(
    function(){
    <?php if(! $contactForm->isNew()):?>
      contactSetupDeleteButton("<?php echo $contactForm->getDeleteUrl()?>",{'iden':"<?php echo $contactForm->getObject()->getIden()?>",});
      contactSetupStatusButton("<?php echo $contactForm->getUpdateStatusUrl()?>",{'iden':"<?php echo $contactForm->getObject()->getIden()?>",});
      contactSetupResetButton("<?php echo $contactForm->getResetUrl()?>",{'iden':"<?php echo $contactForm->getObject()->getIden()?>",});
      contactEditSetup(
        "<?php echo ContactForm::getContactRowId($contactForm->getObject())?>",
        "<?php echo $contactForm->getContactRowUpdateUrl()?>",
        "<?php echo ContactForm::getContactLinkId($contactForm->getObject())?>"
      );
    <?php else:?>      
      contactNewSetup();
      contactSetupResetButton("<?php echo $contactForm->getResetUrl()?>",{});
    <?php endif;?>
    }
  );
</script>